import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      name: 'index-page',
      redirect: '/index',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/index/index.vue'),
      children: [
        {
          path: '/',
          name: 'hot-card',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/hot-card/index.vue')
        },
        {
          path: '/manager',
          name: 'manager',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/manager/index.vue')
        },
        {
          path: '/search',
          name: 'search',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/search/Search.vue')
        }
      ]
    },
    {
      path: '/u',
      name: 'user',
      redirect: '/u/mysite',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/user/index.vue'),
      children: [
        {
          path: '/u/mysite',
          name: 'mysite',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/manager/components/MySite.vue')
        },
        {
          path: '/u/addsite',
          name: 'addsite',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/manager/components/SiteConfig.vue')
        },
        {
          path: '/u/home',
          name: 'home',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/manager/components/Home.vue')
        },
        {
          path: '/u/customize',
          name: 'customize',
          component: () => import(/* webpackChunkName: "introduce" */ '../views/manager/components/Customize.vue')
        },
      ]
      
    },
    {
      path: '/login',
      name: 'login',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/login/index.vue'),
    }
  ]
})

export default router
